package com.topscomm.app.controller;
import java.util.Map;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.topscomm.app.controller.auto.AppPageTabControllerAuto;
import com.topscomm.pub.util.StringBufferProxy;
import com.topscomm.pub.util.StringUtil;


@RestController
@RequestMapping("app/appPageTab")
public class AppPageTabController extends AppPageTabControllerAuto implements IAppPageTabController {
	@Override
	protected String spellListSql(Map paraMap) {
		StringBufferProxy sql = new StringBufferProxy();		
		sql.appendSingle(" enabled=1 ");
		if (paraMap.containsKey("qry_parentid")) {
			String value = paraMap.get("qry_parentid").toString();
			if (!StringUtil.isEmpty(value))
				sql.appendSingle(" and pageid = '{0}'", value);
		}
		if (paraMap.containsKey("qry_name")) {
			String value = paraMap.get("qry_name").toString();
			if (!StringUtil.isEmpty(value))
				sql.appendSingle(" and name like '%{0}%'", value);
		}
		if (paraMap.containsKey("qry_code")) {
			String value = paraMap.get("qry_code").toString();
			if (!StringUtil.isEmpty(value))
				sql.appendSingle(" and code='{0}'", value);
		}
		
		return sql.toString();
	}
}
